//package com.zhz.mall.common.util.feign.config;
//
//import com.ygp.fms.common.config.feign.FeignClientInitializer;
//import com.ygp.fms.common.config.feign.FeignOptionsUtil;
//import com.ygp.fms.common.config.feign.GlobalFeignFallback;
//import feign.Request;
//import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
//import org.springframework.cloud.openfeign.ribbon.FeignRibbonClientAutoConfiguration;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.env.Environment;
//
//import java.util.concurrent.TimeUnit;
//
///**
// * FeignConfiguration
// * <p>
// * feign 配置类
// *
// * @author zhangjiawei@sanyygp.com
// * @version 1.0
// * @date 2021/01/22 10:42
// */
//@Configuration(proxyBeanMethods = false)
//public class FeignConfiguration {
//
//
//    /**
//     * 调整 feign 默认的请求超时时间（方法级别的超时控制见：{@link FeignOptionsUtil}）
//     *
//     * @see FeignRibbonClientAutoConfiguration#feignRequestOptions()
//     */
//    @Bean
//    public Request.Options feignRequestOptions(Environment env) {
//        int connectTimeout = env.getProperty("ribbon.ConnectTimeout", int.class, 3000);
//        int readTimeout = env.getProperty("ribbon.ReadTimeout", int.class, 3000);
//        return new Request.Options(connectTimeout, TimeUnit.MILLISECONDS, readTimeout, TimeUnit.MILLISECONDS, true);
//    }
//
//
//    /**
//     * 提前加载其他服务
//     */
//    @Bean
//    public FeignClientInitializer feignClientInitializer(SpringClientFactory springClientFactory) {
//        return new FeignClientInitializer(springClientFactory);
//    }
//
//
//    /**
//     * feign fallback 处理器
//     */
//    @Bean({"globalFeignFallback", "feignFallbackAspect"})
//    public GlobalFeignFallback globalFeignFallback() {
//        return new GlobalFeignFallback();
//    }
//
//
//
//}
